<?php
	$result = $cn->Add('logs', array('userid'=>$user_id, 'date'=>date('Y-m-d H:i:s'), 'description'=>'User ['.$userdata['name'].'] deleted ['.$table.'] target id ['.$post_id.']', 'type'=>'delete'), false);
	$tbl = $table == 'companies' ? 'users' : $table;
	if ($tbl == 'users') $cn->Query('delete from settcredit where userid='.$post_id, false);
	$cn->Delete($tbl, $post_id);
	$return = isset($_SESSION['return_path']) ? $_SESSION['return_path'] : $path.$table;
	header('location: '.$return);
?>